Conversation
MartinHjelmare
approved these changes
Mar 2, 2018
|
|
||
| if not bridges: | ||
| return self.async_abort( | ||
| reason='No Philips Hue bridges discovered.' |
Member
There was a problem hiding this comment.
Is the style guide that we end these messages with period? Ie not the same as log messages?
Member
Author
There was a problem hiding this comment.
Yes. It will be shown in the UI.
Member
Author
There was a problem hiding this comment.
It will be replaced with translation keys in a future release.
| def _websession(self): | ||
| """Return a websession. | ||
|
|
||
| Cannot assign in init because hass variable is not set yet. |
Member
There was a problem hiding this comment.
Not having access to hass and not passing it explicitly will bite us continuously in code review and as bugs, I think. But maybe there's no way around it?
Member
Author
There was a problem hiding this comment.
I guess we can make a default constructor
Member
Author
There was a problem hiding this comment.
One of the reasons I don't like constructors is that if people override it, we can never change that part anymore.
9 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds a config flow for Philips Hue to allow users to configure it via the UI.
The library that we use to control Philips Hue lights is bad (and unmaintained). It forces everything via a file and will even do auto lookups. It will also not correctly handle if an auth token has been revoked.
Instead of trying to hack around the shortcomings of Phue, I wrote aiohue. It supports registering, fetching config and reading/controlling lights and groups. Oh, and it's async 👍 The goal will be to eventually migrate all of Hue to this lib. For now it's only used to handle authentication in the config flow.
A reminder that the config entry config for Hue will live besides the existing config.
To do:
Out of scope for this PR:
Requires home-assistant/frontend#960 for frontend to work.
Example entry for
configuration.yaml(if applicable):(then navigate to config panel)
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass